package com.gao.service;

import com.gao.entity.Product;
import com.gao.util.ResultVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author gao
 * @time 2022/11/26 15:05:42
 */
@FeignClient("star-product")
public interface ProductService {
    @RequestMapping("/products/{productId}")
    ResultVO find(@PathVariable("productId") Integer productId);

    @RequestMapping("/products/findByProductIds")
    ResultVO findByProductIds(@RequestBody List<Integer> productIds);

    @RequestMapping("/products/deductStock/{productId}/{quantity}")
    ResultVO deductStock(@PathVariable("productId") Integer productId, @PathVariable("quantity") Integer quantity);

    @GetMapping("/products/lb")
    ResultVO testLoadBalance();

    @PostMapping("/products/testObjectParam")
    ResultVO testObjectParam(@RequestBody Product product);
}
